package com.example.common.dto;

import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.Min;
import lombok.Data;

/**
 * @Author moyin
 * @Description TODO
 * @Date 2025/3/25 10:42
 * @Email 82400672@qq.com
 **/
@Data
public class PageRequestDTO {
    @Min(1)
    private int currentPage = 1;

    @Min(1)
    @Max(100)
    private int pageSize = 10;

    // 转换为数据库offset（MyBatis等框架需要）
    public int getOffset() {
        return (currentPage - 1) * pageSize;
    }
}
